package com.limh.base.utils

import android.content.Context
import android.util.DisplayMetrics
import android.view.WindowManager
import com.limh.base.AppConfig

/**
 * @function：
 * @author： limh
 * @date： 2018/11/1
 * Copyright @2018 Corpration Name
 */
object ScreenUtils {

    fun getScreenWidth(): Int {
        val wm = AppConfig.instance.applicationContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
        val dm = DisplayMetrics()
        wm.defaultDisplay.getMetrics(dm)
        return dm.widthPixels
    }

    fun getScreenHeight(): Int {
        val wm = AppConfig.instance.applicationContext.getSystemService(Context.WINDOW_SERVICE) as WindowManager
        val dm = DisplayMetrics()
        wm.defaultDisplay.getMetrics(dm)
        return dm.heightPixels
    }
}